package kr.hkit.powerjava.chapter07;

public class Car {

	private String color;
	private int speed;
	private int gear;

	Car() {
	}

	public Car(String color, int speed, int gear) {
		// super();
		this.color = color;
		this.speed = speed;
		this.gear = gear;
	}
	

	public Car(String color) {
		this(color, 0, 1);
	}
	
	public Car(String color, int speed){
		this(color, speed, 1);
	}
	

	@Override
	public String toString() {// alt shift s, 부모method 재정의
		return "Car [color=" + getColor() + ", speed=" + getSpeed() + ", gear="
				+ getGear() + "]";
	}

	public String getColor() {
		return this.color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public int getGear() {
		return gear;
	}

	public void setGear(int gear) {
		this.gear = gear;
	}

	public int getSpeed() {
		return speed;
	}

	public void setSpeed(int speed) {
		this.speed = speed;
	}

	/*
	 * void print() {// 접근제어자는 default: 같은 패키지만 접근 가능함 System.out.println("(" +
	 * color + ", " + speed + ", " + gear + ")"); }
	 */

}
